import tensorflow as tf

def add_layer(inputs,in_size,out_size,activation_function=None):
    #insize行 outsize列
    Weights=tf.Variable(tf.random_normal([in_size,out_size]))

    #1行outsize列，推荐不是0，在每一步骤训练中，都会有变化
    biases=tf.Variable(tf.zeros([1,out_size]))+0.1

    #y=wx+b
    Wx_plus_b=tf.matmul(inputs,Weights)+biases
    if activation_function is None:
        outputs=Wx_plus_b
    else:
        outputs=activation_function(Wx_plus_b)
    return outputs

